import { createRouter, createWebHistory } from "vue-router";
import Login from "../views/Login.vue";
import Dashboard from "../views/Dashboard.vue";
import Students from "../views/Students.vue";
import Subjects from "../views/Subjects.vue";
import Scores from "../views/Scores.vue";

const routes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    path: "/login",
    component: Login,
  },
  {
    path: "/dashboard",
    component: Dashboard,
    redirect: "/dashboard/students",
    children: [
      {
        path: "students",
        component: Students,
      },
      {
        path: "subjects",
        component: Subjects,
      },
      {
        path: "scores",
        component: Scores,
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
